﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MachineVision.Domain.Migrations
{
    public partial class menu : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Menus",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Icon = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    PageUrl = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Description = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsMain = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    SuperId = table.Column<int>(type: "int", nullable: true),
                    Inactive = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    Remarks = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Menus", x => x.Id);
                    table.ForeignKey(
                        name: "FK_Menus_Menus_SuperId",
                        column: x => x.SuperId,
                        principalTable: "Menus",
                        principalColumn: "Id");
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.InsertData(
                table: "Menus",
                columns: new[] { "Id", "CreateTime", "Description", "Icon", "Inactive", "IsMain", "Name", "PageUrl", "Remarks", "SuperId" },
                values: new object[,]
                {
                    { 1, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, "layui-Icon-time", false, true, "报警/历史", null, null, null },
                    { 2, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, "layui-Icon-camera", false, true, "车辆监控", null, null, null },
                    { 3, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, "layui-Icon-release", false, true, "测试功能", null, null, null }
                });

            migrationBuilder.UpdateData(
                table: "MissionHistoryInfos",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreateTime", "EndTime", "NO", "StartTime" },
                values: new object[] { new DateTime(2022, 9, 6, 16, 35, 56, 304, DateTimeKind.Local).AddTicks(2971), new DateTime(2022, 9, 6, 16, 35, 56, 304, DateTimeKind.Local).AddTicks(2971), "001", new DateTime(2022, 9, 6, 16, 34, 56, 304, DateTimeKind.Local).AddTicks(2971) });

            migrationBuilder.UpdateData(
                table: "PatrolCars",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreateTime",
                value: new DateTime(2022, 9, 6, 16, 35, 56, 304, DateTimeKind.Local).AddTicks(2971));

            migrationBuilder.UpdateData(
                table: "PatrolGroups",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreateTime",
                value: new DateTime(2022, 9, 6, 16, 35, 56, 304, DateTimeKind.Local).AddTicks(2971));

            migrationBuilder.UpdateData(
                table: "TemperatureInfos",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreateTime", "TempTime" },
                values: new object[] { new DateTime(2022, 9, 6, 16, 35, 56, 304, DateTimeKind.Local).AddTicks(2971), new DateTime(2022, 9, 6, 16, 35, 56, 304, DateTimeKind.Local).AddTicks(2971) });

            migrationBuilder.UpdateData(
                table: "TemperatureInfos",
                keyColumn: "Id",
                keyValue: 2,
                columns: new[] { "CreateTime", "TempTime" },
                values: new object[] { new DateTime(2022, 9, 6, 16, 35, 56, 304, DateTimeKind.Local).AddTicks(2971), new DateTime(2022, 9, 6, 16, 35, 56, 304, DateTimeKind.Local).AddTicks(2971) });

            migrationBuilder.UpdateData(
                table: "TemperatureInfos",
                keyColumn: "Id",
                keyValue: 4,
                columns: new[] { "CreateTime", "TempTime" },
                values: new object[] { new DateTime(2022, 9, 6, 16, 35, 56, 304, DateTimeKind.Local).AddTicks(2971), new DateTime(2022, 9, 6, 16, 35, 56, 304, DateTimeKind.Local).AddTicks(2971) });

            migrationBuilder.UpdateData(
                table: "WarningInfos",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreateTime", "NO", "Time" },
                values: new object[] { new DateTime(2022, 9, 6, 16, 35, 56, 304, DateTimeKind.Local).AddTicks(2971), "001", new DateTime(2022, 9, 6, 16, 35, 56, 304, DateTimeKind.Local).AddTicks(2971) });

            migrationBuilder.InsertData(
                table: "Menus",
                columns: new[] { "Id", "CreateTime", "Description", "Icon", "Inactive", "IsMain", "Name", "PageUrl", "Remarks", "SuperId" },
                values: new object[,]
                {
                    { 11, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null, false, false, "报警信息", "report/warning.html", null, 1 },
                    { 12, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null, false, false, "任务历史", "report/history.html", null, 1 },
                    { 21, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null, false, false, "视频监控(标准流)", "videos/basicvideo.html", null, 2 },
                    { 22, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null, false, false, "视频监控(UIKIT)", "videos/uikitvideo.html", null, 2 },
                    { 31, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null, false, false, "测试页面", "test/test.html", null, 3 }
                });

            migrationBuilder.CreateIndex(
                name: "IX_Menus_SuperId",
                table: "Menus",
                column: "SuperId");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Menus");

            migrationBuilder.UpdateData(
                table: "MissionHistoryInfos",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreateTime", "EndTime", "NO", "StartTime" },
                values: new object[] { new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894), new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894), null, new DateTime(2022, 8, 25, 12, 37, 11, 608, DateTimeKind.Local).AddTicks(1894) });

            migrationBuilder.UpdateData(
                table: "PatrolCars",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreateTime",
                value: new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894));

            migrationBuilder.UpdateData(
                table: "PatrolGroups",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreateTime",
                value: new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894));

            migrationBuilder.UpdateData(
                table: "TemperatureInfos",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreateTime", "TempTime" },
                values: new object[] { new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894), new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894) });

            migrationBuilder.UpdateData(
                table: "TemperatureInfos",
                keyColumn: "Id",
                keyValue: 2,
                columns: new[] { "CreateTime", "TempTime" },
                values: new object[] { new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894), new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894) });

            migrationBuilder.UpdateData(
                table: "TemperatureInfos",
                keyColumn: "Id",
                keyValue: 4,
                columns: new[] { "CreateTime", "TempTime" },
                values: new object[] { new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894), new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894) });

            migrationBuilder.UpdateData(
                table: "WarningInfos",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "CreateTime", "NO", "Time" },
                values: new object[] { new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894), null, new DateTime(2022, 8, 25, 12, 38, 11, 608, DateTimeKind.Local).AddTicks(1894) });
        }
    }
}
